class Model {
    // 构造函数
    constructor(data, message) {
        if (typeof data === 'string') {
            this.message = data;
        } else {
            if (data) {
                this.data = data
            }
            if (message) {
                this.message = message
            }
        }
    }
}

class SuccessModel extends Model {
    constructor(data, message) {
        super(data, message) // 调用父类的constructor
        this.success = true;
    }
}

class ErrorModel extends Model {
    constructor(data, message) {
        super(data, message)
        this.success = false;
    }
}
module.exports = {
    SuccessModel,
    ErrorModel
}
// // ES5  面向对象
// function Model () {

// }
// Model.prototype.xx = ()
// new Model()